/**
 * 
 */
package com.rst.doc.domain;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * @author JavaDeamon
 *
 */
@Entity
@Table(name="DOCUMENT_CATEGORY_DETAILS")
public class DocumentCategoryDetailsDTO implements Serializable{

	
	/**
	 * 
	 */
	private static final long serialVersionUID = -207729455064932759L;
	private Integer docCategId;
	private String docCategName;
	private String docCategCode;
	private List<DocumentSubCategoryDetailsDTO> docSubCategList = new ArrayList<DocumentSubCategoryDetailsDTO>();
	private DocumentTypeDetailsDTO docType;
	
	
	/**
	 * @return the docCategId
	 * primary key
	 * auto generated id
	 * length is 10
	 */
	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)
	@Column(name="DOC_CATEG_ID", length=10)
	public Integer getDocCategId() {
		return docCategId;
	}
	/**
	 * @return the docCategName
	 * contains doc category name
	 * cannot be null
	 * length is 60
	 */
	@Column(name="DOC_CATEG_NAME", nullable=false, length=60)
	public String getDocCategName() {
		return docCategName;
	}
	/**
	 * @return the docCategCode
	 * contains doc category code
	 * cannot be null
	 * length is 20
	 */
	@Column(name="DOC_CATEG_CODE", nullable=false, length=20)
	public String getDocCategCode() {
		return docCategCode;
	}
	/**
	 * @return the docSubCategList
	 * one to many mapping with doc subcateg table
	 */
	@OneToMany(targetEntity=DocumentSubCategoryDetailsDTO.class, mappedBy="docCategory")
	public List<DocumentSubCategoryDetailsDTO> getDocSubCategList() {
		return docSubCategList;
	}
	/**
	 * @return the docType
	 * mapped by doc type details table
	 * contains mapping with primary key
	 * cannot be null
	 */
	@ManyToOne(targetEntity=DocumentTypeDetailsDTO.class)
	@JoinColumn(name="DOC_TYPE_ID", nullable=false)
	public DocumentTypeDetailsDTO getDocType() {
		return docType;
	}
	/**
	 * @param docCategId the docCategId to set
	 */
	public void setDocCategId(Integer docCategId) {
		this.docCategId = docCategId;
	}
	/**
	 * @param docCategName the docCategName to set
	 */
	public void setDocCategName(String docCategName) {
		this.docCategName = docCategName;
	}
	/**
	 * @param docCategCode the docCategCode to set
	 */
	public void setDocCategCode(String docCategCode) {
		this.docCategCode = docCategCode;
	}
	/**
	 * @param docSubCategList the docSubCategList to set
	 */
	public void setDocSubCategList(
			List<DocumentSubCategoryDetailsDTO> docSubCategList) {
		this.docSubCategList = docSubCategList;
	}
	/**
	 * @param docType the docType to set
	 */
	public void setDocType(DocumentTypeDetailsDTO docType) {
		this.docType = docType;
	}
}
